package com.damei.qmui_test_demo;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Handler;

import com.damei.qmui_test_demo.activity.LoginActivity;
import com.damei.qmui_test_demo.base.TabBarActivity;
import com.damei.qmui_test_demo.httpService.HttpManager;
import com.damei.qmui_test_demo.httpService.HttpStringResponseHandler;
import com.damei.qmui_test_demo.model.LoginResponse;
import com.damei.qmui_test_demo.model.MeiZiResponse;
import com.lzy.okgo.model.Response;

import java.util.HashMap;
import java.util.Map;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        SharedPreferences preferences = getSharedPreferences("LOGIN_INFO", MODE_PRIVATE);
        String userId = preferences.getString("userId", "");

        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                if (userId.equals("denglong")) {
                    startActivity(new Intent(MainActivity.this, TabBarActivity.class));
                } else {
                    startActivity(new Intent(MainActivity.this, LoginActivity.class));
                }
                finish();
            }
        }, 1000);
    }
}
